home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Networking / GetPPPStatus / OpenTptPPP.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  6.6 KB  |  235 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        OpenTptPPP.h
  3.  
  4.     Contains:    XTI-based PPP application programmer's interface. 
  5.  
  6.     Written by:     
  7.  
  8.     Copyright:    Copyright © 1996-1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 7/22/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. */
  23. #ifndef __OPENTPTPPP__
  24. #define __OPENTPTPPP__
  25.  
  26. #ifndef REZ
  27.  
  28.     #ifndef __OPENTPTINTERNET__
  29.     #include <OpenTptInternet.h>
  30.     #endif
  31.     
  32. #endif
  33.  
  34.  
  35. /*******************************************************************************
  36. *    Constants
  37. ********************************************************************************/
  38.  
  39. //
  40. // OTCreateConfiguration name for PPP control endpoint
  41. //
  42.  
  43. #define kPPPControlName        "ppp"    
  44.     
  45.  
  46. //
  47. // XTI Level
  48. //
  49.  
  50. #define COM_PPP                'PPPC'
  51.  
  52.  
  53. //
  54. // Options limits
  55. //
  56.  
  57. #define kPPPMaxIDLength                        255
  58. #define kPPPMaxPasswordLength                255
  59. #define kPPPMaxDTEAddressLength                127
  60. #define kPPPMaxCallInfoLength                255
  61.  
  62.  
  63. //
  64. // Various XTI option value constants
  65. //
  66.  
  67. #define kPPPStateInitial                    1
  68. #define kPPPStateClosed                        2
  69. #define kPPPStateClosing                    3
  70. #define kPPPStateOpening                    4
  71. #define kPPPStateOpened                        5
  72.  
  73. #define kPPPConnectionStatusIdle            1
  74. #define kPPPConnectionStatusConnecting        2
  75. #define kPPPConnectionStatusConnected        3
  76. #define kPPPConnectionStatusDisconnecting    4
  77.  
  78. #define kPPPMinMRU                            0
  79. #define kPPPMaxMRU                            4500
  80.  
  81. #define kIPCPTCPHdrCompressionDisabled        0
  82. #define kIPCPTCPHdrCompressionEnabled        1
  83.  
  84. #define kPPPCompressionDisabled                0x00000000
  85. #define kPPPProtoCompression                0x00000001
  86. #define kPPPAddrCompression                    0x00000002
  87.  
  88. #define kPPPNoOutAuthentication                0
  89. #define kPPPCHAPOrPAPOutAuthentication        1 
  90.  
  91. #define kCCReminderTimerDisabled            0
  92. #define kCCIPIdleTimerDisabled                0
  93.  
  94. #define kPPPScriptTypeModem                    1
  95. #define kPPPScriptTypeConnect                2
  96. #define kPPPMaxScriptSize                    32000
  97.  
  98. #define kE164Address                        1
  99. #define kPhoneAddress                        1
  100. #define kCompoundPhoneAddress                2
  101. #define kX121Address                        3
  102.  
  103. #define kPPPConnectionStatusDialogsFlag        0x00000001
  104. #define kPPPConnectionRemindersFlag            0x00000002
  105. #define kPPPConnectionFlashingIconFlag        0x00000004
  106. #define kPPPOutPasswordDialogsFlag            0x00000008
  107. #define kPPPAllAlertsDisabledFlag            0x00000000
  108. #define kPPPAllAlertsEnabledFlag            0x0f
  109.  
  110. #define kPPPAsyncMapCharsNone                0
  111. #define kPPPAsyncMapCharsXOnXOff            0x000a0000
  112. #define kPPPAsyncMapCharsAll                0xffffffff
  113.  
  114.  
  115. #ifndef REZ
  116.  
  117.     //
  118.     // Option names
  119.     //
  120.     
  121.     enum 
  122.     {
  123.         IPCP_OPT_GETREMOTEPROTOADDR        = (OTXTIName)0x7000,
  124.         IPCP_OPT_GETLOCALPROTOADDR        = (OTXTIName)0x7001,
  125.         IPCP_OPT_TCPHDRCOMPRESSION        = (OTXTIName)0x7002,
  126.         LCP_OPT_PPPCOMPRESSION            = (OTXTIName)0x7003,
  127.         LCP_OPT_MRU                        = (OTXTIName)0x7004,
  128.         LCP_OPT_RCACCMAP                = (OTXTIName)0x7005,
  129.         LCP_OPT_TXACCMAP                = (OTXTIName)0x7006,
  130.         SEC_OPT_OUTAUTHENTICATION        = (OTXTIName)0x7007,
  131.         SEC_OPT_ID                        = (OTXTIName)0x7008,
  132.         SEC_OPT_PASSWORD                = (OTXTIName)0x7009,
  133.         CC_OPT_REMINDERTIMER            = (OTXTIName)0x7010,
  134.         CC_OPT_IPIDLETIMER                = (OTXTIName)0x7011,
  135.         CC_OPT_DTEADDRESSTYPE            = (OTXTIName)0x7012,
  136.         CC_OPT_DTEADDRESS                = (OTXTIName)0x7013,
  137.         CC_OPT_CALLINFO                    = (OTXTIName)0x7014,
  138.         CC_OPT_GETMISCINFO                = (OTXTIName)0x7015,
  139.         PPP_OPT_GETCURRENTSTATE            = (OTXTIName)0x7016
  140.     };
  141.     
  142.     
  143.     //
  144.     // Endpoint events
  145.     //
  146.     
  147.     enum
  148.     {
  149.         kPPPEvent                        = (OTEventCode) kPROTOCOLEVENT | 0xf0000,
  150.         kPPPConnectCompleteEvent        = (OTEventCode) kPPPEvent+1,
  151.         kPPPSetScriptCompleteEvent        = (OTEventCode) kPPPEvent+2,
  152.         kPPPDisconnectCompleteEvent        = (OTEventCode) kPPPEvent+3,
  153.         kPPPDisconnectEvent                = (OTEventCode) kPPPEvent+4,
  154.         kPPPIPCPUpEvent                    = (OTEventCode) kPPPEvent+5,
  155.         kPPPIPCPDownEvent                = (OTEventCode) kPPPEvent+6,
  156.         kPPPLCPUpEvent                    = (OTEventCode) kPPPEvent+7,
  157.         kPPPLCPDownEvent                = (OTEventCode) kPPPEvent+8,
  158.         kPPPLowerLayerUpEvent            = (OTEventCode) kPPPEvent+9,
  159.         kPPPLowerLayerDownEvent            = (OTEventCode) kPPPEvent+10,
  160.         kPPPAuthenticationStartedEvent    = (OTEventCode) kPPPEvent+11,
  161.         kPPPAuthenticationFinishedEvent    = (OTEventCode) kPPPEvent+12,
  162.         kPPPDCEInitStartedEvent            = (OTEventCode) kPPPEvent+13,
  163.         kPPPDCEInitFinishedEvent        = (OTEventCode) kPPPEvent+14,
  164.         kPPPDCECallStartedEvent            = (OTEventCode) kPPPEvent+15,
  165.         kPPPDCECallFinishedEvent        = (OTEventCode) kPPPEvent+16
  166.     };
  167.     
  168.     
  169.     /*******************************************************************************
  170.     *    IOCTL constants for I_OTConnect, I_OTDisconnect and I_OTScript
  171.     *    are defined in OpenTransport.h
  172.     ********************************************************************************/
  173.     
  174.  
  175.     /*******************************************************************************
  176.     *    PPPMRULimits
  177.     ********************************************************************************/
  178.     
  179.     typedef struct
  180.     {
  181.         UInt32    mruSize;            // proposed or actual
  182.         UInt32    upperMRULimit;
  183.         UInt32    lowerMRULimit;
  184.     }
  185.     PPPMRULimits;
  186.     
  187.     
  188.     /*******************************************************************************
  189.     *    CCMiscInfo
  190.     ********************************************************************************/
  191.     
  192.     typedef struct
  193.     {
  194.         UInt32    connectionStatus;
  195.         UInt32    connectionTimeElapsed;
  196.         UInt32    connectionTimeRemaining;
  197.         UInt32    bytesTransmitted;
  198.         UInt32    bytesReceived;
  199.         UInt32    reserved;
  200.     }
  201.     CCMiscInfo;
  202.  
  203.  
  204. #endif    /* #ifndef REZ */
  205.  
  206.  
  207. /*******************************************************************************
  208. *    Gestalt Selectors for Open Transport-based Remote Access/PPP
  209. *
  210. *    Note: possible values for the version "stage" byte are:
  211. *    development = 0x20, alpha = 0x40, beta = 0x60, final & release = 0x80
  212. ********************************************************************************/
  213.  
  214. //
  215. // Response bit positions for gestaltOpenTptRemoteAccess.
  216. //
  217.  
  218. #define kRAProductClientOnly                    2
  219. #define kRAProductOnePortServer                    3
  220. #define kRAProductManyPortServer                4
  221.  
  222. #define gestaltOpenTptRemoteAccessPresent        0
  223. #define gestaltOpenTptRemoteAccessLoaded        1
  224. #define gestaltOpenTptRemoteAccessClientOnly    kRAProductClientOnly
  225. #define gestaltOpenTptRemoteAccessPServer        kRAProductOnePortServer
  226. #define gestaltOpenTptRemoteAccessMPServer        kRAProductManyPortServer
  227. #define gestaltOpenTptPPPPresent                5
  228. #define gestaltOpenTptARAPPresent                6
  229.  
  230. #define gestaltOpenTptRemoteAccess                'otra'
  231. #define gestaltOpenTptRemoteAccessVersion        'otrv'
  232.  
  233.  
  234. #endif    /* __OPENTPTPPP__ */
  235.